cutting boards hackerrank solution